<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
<div id="app">
    内容<input type="text" v-model="content"> <buttom @click="submit">添加备忘录</buttom>
    <ul>
        <li v-for="(data,index) in dataModelList" :key="index">{{index+1}}.{{data.content}}   <a  @click="delete2(index,data.content)">删除</a></li>
    </ul>
    <a href="javascript:;" @click="clear">清空备忘录</a>
    <h1>当前备忘录：{{dataModelList.length}} 条</h1>
</div>
</body>
</html>

<style>


</style>


<script src="../js/v2.6.10/vue.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            countNum: 0,
            dataModelList: [
                {
                    content: '吃饭'
                }, {
                    content: '打球'
                }, {
                    content: '吹牛'
                }
            ]
        },
        methods: {
            submit() {
				console.log(this.content)
				this.dataModelList.push({content:this.content})
            },
			delete2(index,content){
				console.log("删除",index)
				// this.dataModelList.filter(content,index)
			},
			clear(){
				this.dataModelList= '';
			}
        },
        computed: {}
    })
</script>